var PageProduct={
    template:`
    <div class="pageproducted">
    <div class="pageproduct" v-show="show">
        <div class="title">
            <span>基本信息</span>
        </div>
        <div class="content">
            <ul class="content_fir">
                <li><span>产品名称</span><input type="text" placeholder="输入商品名称"></li>
                <li><span>产品价格</span><input type="text" placeholder="输入商品价格"></li>
                <li><span>活动时间</span>
                <div class="demoBox">
                <div class="demo">
                    <input type="text" id="dateSelectorOne" placeholder="请选择">
                </div>
               </div>
               <span>到</span>
                <div class="demoBox">
                <div class="demo">
                    <input type="text" id="dateSelectorTwo" placeholder="请选择">
                </div>
               </div>
                </li>
                <li class="last_intr">
                <span>活动介绍</span>
                <textarea name="txt" placeholder="请输入产品介绍..." maxlength="300" @keyup="reduce" v-model="val"></textarea>
                <span>{{num}}/300</span>
                </li>
            </ul>
            <p><span>上传图片</span></p>
            <ul class="content_last">
                <li>
                <span>banner图</span>
                <v-touch v-for="item,i in curImgs" v-bind:key="item.i">
                    <v-touch @tap="addImgs(i)"><img :src="item.img"/></v-touch>
                    <v-touch @tap="delImgs(i)" v-if="item.ishow"><img :src="item.img2"/></v-touch>
                </v-touch>
                <span>查看大图</span>
                </li>
                <li>
                <span>详情图</span>
                <v-touch v-for="item,i in curImg" v-bind:key="item.i">
                    <v-touch @tap="addImg(i)"><img :src="item.img"/></v-touch>
                    <v-touch @tap="delImg(i)" v-if="item.ishow"><img :src="item.img2"/></v-touch>
                </v-touch>
                <span>查看大图</span>
                </li>
            </ul>
            <span></span>
            <div class="switch">
            <span>开/关产品：</span>
            <input type="checkbox" id="checkbox_a1" class="chk_1" checked /><label for="checkbox_a1"></label>
            <span>开启产品</span>
            </div>
        </div>
        <div class="footer">
            <v-touch v-on:tap="del"><button>删除活动</button></v-touch><v-touch @tap="add"><button id="btn">保存活动</button></v-touch>
        </div>
    </div>
    <div class="mask" v-show="hidden">
        <div class="bgc"></div>
        <div class="msg">
            <p>是否确认删除产品？</p>
            <v-touch @tap="cancel"><button class="cancel">取消</button></v-touch><v-touch @tap="notarize"><button class="confirm">确认</button></v-touch>
        </div>
    </div>
    <div class="suc" v-show="!show">
        <div class="suc_img"><img src="../imgs/icon/suc.png"/></div>
    </div>
    </div>
    `,
    data(){
        return {
            title:"基本信息",
            show:true,
            hidden:false,
            num:0,
            val:"",
            curImg:[
                {img:"../imgs/icon/add.png",img2:"../imgs/icon/sczp.PNG",ishow:false},
                {img:"../imgs/icon/add.png",img2:"../imgs/icon/sczp.PNG",ishow:false},
                {img:"../imgs/icon/add.png",img2:"../imgs/icon/sczp.PNG",ishow:false}
            ],
            curImgs:[
                {img:"../imgs/icon/add.png",img2:"../imgs/icon/sczp.PNG",ishow:false},
                {img:"../imgs/icon/add.png",img2:"../imgs/icon/sczp.PNG",ishow:false},
                {img:"../imgs/icon/add.png",img2:"../imgs/icon/sczp.PNG",ishow:false}
            ]
        }
    },
    methods:{
        del(){
           this.hidden=true;
        },
        add(){
            console.log(1);
            this.show=false;
        },
        reduce(){
           if(this.val.length==null){
                this.num=0;
            }else{
                this.num=this.val.length;
            }
        },
        cancel(){
            this.hidden=false;
        },
        notarize(){
            this.hidden=false;
        },
        addImg(i){
           this.curImg[i].img="../imgs/icon/photo.png";
           this.curImg[i].ishow=true;
        },
        delImg(i){
            this.curImg[i].img="../imgs/icon/add.png";
            this.curImg[i].ishow=false;
        },
        addImgs(i){
            this.curImgs[i].img="../imgs/icon/photo.png";
            this.curImgs[i].ishow=true;
        },
        delImgs(i){
            this.curImgs[i].img="../imgs/icon/add.png";
            this.curImgs[i].ishow=false;
        }
    }
}